Skip to content

Conversation

@bsbodden
Copy link

Thank you for taking time to contribute this pull request!
You might have already read the contributor guide, but as a reminder, please make sure to:

  • Add a Signed-off-by line to each commit (git commit -s) per the DCO
  • Rebase your changes on the latest main branch and squash your commits
  • Add/Update unit tests as needed
  • Run a build and make sure all tests pass prior to submission

For more details, please check the contributor guide.
Thank you upfront!

bsbodden and others added 4 commits May 3, 2025 16:02
…ntations

Add comprehensive Redis-backed features to enhance Spring AI:

* Add semantic caching for chat responses:
  - SemanticCache interface and Redis implementation using vector similarity
  - SemanticCacheAdvisor for intercepting and caching chat responses
  - Uses vector search to cache and retrieve responses based on query similarity
  - Support for TTL-based cache expiration
  - Improves response times and reduces API costs for similar questions

* Add Redis-based chat memory implementation:
  - RedisChatMemory using RedisJSON + RediSearch for conversation storage
  - Configurable RedisChatMemoryConfig with builder pattern support
  - Message TTL, ordering, multi-conversation and batch operations
  - Efficient conversation history retrieval using RediSearch indexes

* Add integration tests:
  - Comprehensive test coverage using TestContainers
  - Tests for semantic caching features and chat memory operations
  - Integration test for RedisVectorStore with VectorStoreChatMemoryAdvisor
  - Verify chat completion augmentation with vector store content

The Redis implementations enable efficient storage and retrieval of chat
responses and conversation history, with semantic search capabilities and
configurable persistence options.

Signed-off-by: Brian Sam-Bodden <[email protected]>
…nectivity

  Refactor Redis-based chat memory implementation to:
  - Implement ChatMemoryRepository interface as requested in PR spring-projects#2295
  - Fix Redis connection issues in integration tests reported in PR spring-projects#2982
  - Optimize conversation ID lookup with server-side deduplication
  - Add configurable result limits to avoid Redis cursor size limitations
  - Implement robust fallback mechanism for query failures
  - Enhance support for metadata, toolcalls, and media in messages
  - Add comprehensive test coverage with reliable Redis connections

Signed-off-by: Brian Sam-Bodden <[email protected]>
Signed-off-by: Brian Sam-Bodden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants